/**
 * 过滤器
 */

import { DOMAIN } from './static/config/index'
import noImage from './static/images/no_image.png'

const filters = {
  filterNull(value) {
    if (value == null) {
      value = ''
    }
    return value
  },
  filterImg(value) {
    if (value === '') {
      return noImage
    } else {
      return value.startsWith('http') ? value : DOMAIN + value
    }
  }
}

export default filters
